@use "sass:color";
@use "mixins";
@use "variables";

// sass-lint:disable class-name-format no-qualifying-elements id-name-format

#adminmenu .wp-submenu a[href='edit.php?post_type=ctct_forms&page=ctct_options_connect'] {
	color: variables.$color-light-green;
}

//--------------------------------------------------------------
// Connect/Disconnect Page
//--------------------------------------------------------------

.wrap.ctct_options_connect {
	box-sizing: border-box;

	* {
	  box-sizing: border-box;
	}

  	& {
	  margin: 35px auto 0;
	  padding: 35px;
	}
	@include mixins.wider-than('small') {
	  margin: 55px auto 0;
	}
	& {
	  max-width: 850px;
	  position: relative;
	  background-color: variables.$color-white;
	  border: 1px solid variables.$color-silver;
	  border-radius: 8px;
	  box-shadow: variables.$shadow_lg;
	  text-align: center;
	  z-index: 1;
	}

	&.text-left{
		text-align: left;
	}

  	&.connected::before {
		width: 46px;
		height: 46px;
		position: absolute;
		left: 50%;
		top: -23px;
		margin-left: -23px;
		display: block;
		border-radius: 100%;
		content: '';
		z-index: -1;
		border-top: 1px solid variables.$color-silver;
		background: variables.$color-white url('../images/ctct_ripple.svg') no-repeat center 45%;
		background-size: 60%;
	}

	h2{
	  font-size: 24px;
	  font-weight: 700;
	  margin: 0 0 15px;
	  padding: 0;

	  + p {
		 font-size: 16px;
		 margin: 0 0 25px;
		 padding: 0 10% 25px;
		 position: relative;

		 &::after{
			position: absolute;
			content: '';
			height: 1px;
			width: 50px;
			left: 50%;
			bottom: 0;
			margin-left: -25px;
			background-color: variables.$color-silver;
		 }
	  }
	}

	.ctct-connected-wrap{
		padding: 45px 35px;
		background-color: variables.$color-lighter-gray;
		border-radius: variables.$radius;
	}

	.ctct-call-to-actions{
		display: flex;
		flex-wrap: wrap;
		width: 100%;
		justify-content: space-between;

		&--item {
			width: 100%;
			margin: 0 0 25px;
			@include mixins.wider-than('small') {
				width: calc(50% - 5px);
			}
			& {
			  padding: 30px 25px 25px;
			  background-color: variables.$color-lighter-gray;
			  display: flex;
			  justify-content: center;
			  flex-wrap: wrap;
			  border-radius: 6px;
			  border: 1px solid variables.$color-light-gray;
			  transition: all 0.15s ease;
			}

			&:hover{
				box-shadow: variables.$shadow_lg;
			}

			&.connect-account{
				border-color: variables.$connect-border;
				background-color: variables.$connect-background;

				&:hover{
					border-color: variables.$connect-border-hover;
				}
			}

			&.no-account{
				border-color: variables.$noaccount-border;
				background-color: variables.$noaccount-background;

				&:hover{
					border-color: variables.$noaccount-border-hover;
				}
			}

			p{
				margin-bottom: 15px;
				line-height: 1.6;
				padding: 0 5px;
			}
		}
	}

	h3 {
		font-size: 16px;
		font-weight: 700;
		line-height: 1.55;
		margin: 0 0 10px;
	}

	p {
		color: variables.$color-modal-alt-text;
		font-size: 14px;
		margin-top: 0;

		&.small {
			color: variables.$color-light-silver;
			font-size: 12px;
			margin: 0 auto;
			padding: 0 10%;
			line-height: 1.75;
			text-align: center;
		}
	}

	hr{
		margin: 35px 0;
	}

	.button.ctct-button {
		border-radius: 4px;
		color: variables.$color-prussian-blue;
		font-size: 16px;
		font-weight: 600;
		height: auto;
		line-height: 1;
		margin: 25px 0 0;
		min-width: 180px;
		padding: 14px 30px;
		align-self: flex-end;
		width: 100%;
		transition: all 0.15s ease;

		&.button-orange {
			background-color: variables.$color-chrome-yellow;
			border: 1px solid color.adjust(variables.$color-chrome-yellow, $lightness: -10%);
			color: variables.$color-white;

			&:hover,
			&:focus {
				color: variables.$color-white;
				background-color: color.adjust(variables.$color-chrome-yellow, $lightness: 10%);
			}
		}

		&.button-blue {
			background-color: variables.$color-prussian-blue;
			border: 1px solid color.adjust(variables.$color-prussian-blue, $lightness: -10%);
			color: variables.$color-white;

			&:hover,
			&:focus {
				color: variables.$color-white;
				background-color: color.adjust(variables.$color-prussian-blue, $lightness: 10%);
			}
		}
	}

	.ctct-connection-notice {
		color: variables.$color-red;
	}
}

.ctct-wrap {
  margin: 35px auto 0;
  padding: 35px 45px 0;

  max-width: 850px;
  background-color: variables.$color-connect-background;
  border-radius: 12px;
  border: solid variables.$color-connect-border 1px;
  box-shadow: 0 0 2px variables.$color-connect-text;

  .not-connected {
	box-sizing: border-box;

	* {
	  box-sizing: border-box;
	}

	a {
	  color: variables.$color-connect-button-primary;
	}


	color: variables.$color-connect-text;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 20px;


	@include mixins.wider-than('small') {
	  flex-direction: row;
	}

	h2 {
	  color: variables.$color-connect-text;
	  font-size: 1.8rem;
	  line-height: 1.5;
	  margin-top: 0;
	}

	.ctct-logo {
	  background: transparent url('../images/ctct_ripple.svg') no-repeat;
	  background-size: 75%;
	  height: 50px;
	  width: 50px;
	}
	.ctct-cta-left,
	.ctct-cta-right {
	  flex: 2 1;

	  .button.ctct-button {
		border-radius: 8px;
		color: variables.$color-connect-button-secondary;
		font-size: 16px;
		height: auto;
		line-height: 1;
		padding: 14px 30px;
		transition: all 0.15s ease;

		&.button-blue {
		  background-color: variables.$color-connect-button-primary;
		  border: 1px solid color.adjust(variables.$color-connect-button-primary, $lightness: -10%);
		  color: variables.$color-white;

		  &:hover,
		  &:focus {
			color: variables.$color-white;
			background-color: color.adjust(variables.$color-connect-button-primary, $lightness: 10%);
		  }
		}
		&.ctct-signup {
		  background: transparent;
		  border-color: variables.$color-connect-button-secondary;
		  color: variables.$color-connect-button-secondary;
		}
	  }
	}

	.ctct-cta-left {
	  flex: 2;
	  .cta-buttons {
		display: flex;
		gap: 10px;
		flex-direction: column;
		text-align: center;
		@include mixins.wider-than('small') {
		  flex-direction: row;
		}
		@include mixins.wider-than('small') {
		  text-align: left;
		}
	  }
	}

	.ctct-cta-right {
	  flex: 1;
	}
  }

  .ctct-connection-notice {
	color: variables.$color-red;
  }
}

// Connection Details
.ctct-connected-wrap{

	.ctct-connection-details{
		display: flex;
		text-align: left;
		margin: 10px 0 0;

		> p,
		form{
			padding: 0 10px;
			width: 50%;
			text-align: left;
			display: flex;
			align-items: center;
			margin: 0;

			&:not(form):first-of-type{
				text-align: right;
			}

			input{
				position: relative;
				top: 2px;
			}
		}

		p{
			overflow: hidden;
			white-space: nowrap;
			text-overflow: ellipsis;

			&.ctct-label{
				justify-content: flex-end;
			}
		}
	}
}

// Getting Started/ Next Steps

.ctct-connected-next-step{
	text-align: left;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	width: 100%;

	p{
		margin: 0 0 15px;
	}

	> div{
		width: 100%;
		@include mixins.wider-than('small') {
			width: calc(50% - 10px);
		}
	}

	.ctct-video{
		margin-bottom: 15px;
		@include mixins.wider-than('small') {
			margin-bottom: 0;
			padding-right: 5px;
		}

		.wistia_embed{
			max-width: 100%;
			border-radius: variables.$radius;
			overflow: hidden;
		}
	}
}

.ctct-error {
	background: none !important;
	border: 1px solid variables.$color-red;
	border-radius: variables.$radius;
	box-shadow: none !important;
	display: inline-block;
	padding: 15px;
	margin: 0 0 25px 0 !important;

	p {
		color: variables.$color-red !important;
	}

}
