/**
 * Yardi Form Loading Indicator Styles
 * @package Yardi_Custom_Form
 */

/* ===========================================
   LOADING INDICATOR STYLES
   =========================================== */

.yardi-submit-wrapper {
    position: relative;
}

.yardi-form-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 20px;
    margin-top: 15px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #4CAF50;
    border-radius: 8px;
    animation: yardi-fadeIn 0.3s ease-out;
}

@keyframes yardi-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.yardi-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #c8e6c9;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: yardi-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes yardi-spin {
    to {
        transform: rotate(360deg);
    }
}

.yardi-loading-text {
    color: #2e7d32;
    font-size: 0.95em;
    font-weight: 500;
}

/* Submitting button state */
input[type="submit"].submitting,
button.submitting {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

/* ===========================================
   ERROR BANNERS (form-level failures)
   Used by tour-scheduler.js (.yardi-tour-error-message)
   and contact form (.yardi-error-message)

   Intentionally subtle - we want the user to notice it
   without feeling shouted at.
   =========================================== */

.yardi-tour-error-message,
.yardi-error-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    margin: 12px 0;
    background: #fdecea;
    border-left: 3px solid #c0392b;
    border-radius: 4px;
    color: #5b1f17;
    font-size: 0.9em;
    line-height: 1.45;
    animation: yardi-fadeIn 0.2s ease-out;
}

.yardi-tour-error-icon {
    display: none; /* keep markup intact, just hide the loud red dot */
}

.yardi-tour-error-text {
    flex: 1;
    color: inherit;
    font-weight: 500;
}

@media (max-width: 480px) {
    .yardi-tour-error-message,
    .yardi-error-message {
        padding: 9px 12px;
        font-size: 0.88em;
    }
}

/* ===========================================
   FORM HEADER PADDING
   h2/p sit outside .socialItems-form (theme padding);
   on mobile they can run flush to the container edge.
   =========================================== */

.socialItems-formBoxKustom > h2,
.socialItems-formBoxKustom > p {
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
}

@media (max-width: 480px) {
    .socialItems-formBoxKustom > h2,
    .socialItems-formBoxKustom > p {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ===========================================
   MOBILE RESPONSIVE ADJUSTMENTS
   =========================================== */

@media (max-width: 480px) {
    .yardi-form-loading {
        flex-direction: column;
        gap: 10px;
        padding: 12px 15px;
        text-align: center;
    }
    
    .yardi-loading-text {
        font-size: 0.9em;
    }
}

/* Shared form shell. This belongs to Yardi, not the child theme. */
.socialItems-formBoxKustom h2 {
    text-align: center;
    color: white;
    padding: 50px 10px 10px;
}

.socialItems-formBoxKustom p {
    color: white;
    text-align: center;
}

.socialItems-form {
    background-color: #0c3e42;
    padding: 30px 5px 70px;
    margin: 0 auto;
}

.socialItems-form iframe {
    background-color: white;
    padding: 20px;
    resize: both;
    overflow: auto;
    height: 720px;
    max-width: 90%;
    margin: 0 auto;
    text-align: center;
    display: block;
}

.socialItems-formBoxKustom input[type="date"] {
    position: relative;
    color: #000;
    padding-right: 15px;
}

.socialItems-formBoxKustom input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    padding-right: 10px;
    height: 100%;
    width: 30px;
    background-position: right;
    cursor: pointer;
}

.socialItems-formBoxKustom input[type="date"]::-webkit-datetime-edit-text,
.socialItems-formBoxKustom input[type="date"]::-webkit-datetime-edit-month-field,
.socialItems-formBoxKustom input[type="date"]::-webkit-datetime-edit-day-field,
.socialItems-formBoxKustom input[type="date"]::-webkit-datetime-edit-year-field {
    color: transparent;
}

.socialItems-formBoxKustom input[type="date"]:focus::-webkit-datetime-edit-text,
.socialItems-formBoxKustom input[type="date"]:focus::-webkit-datetime-edit-month-field,
.socialItems-formBoxKustom input[type="date"]:focus::-webkit-datetime-edit-day-field,
.socialItems-formBoxKustom input[type="date"]:focus::-webkit-datetime-edit-year-field,
.socialItems-formBoxKustom input[type="date"]:valid::-webkit-datetime-edit-text,
.socialItems-formBoxKustom input[type="date"]:valid::-webkit-datetime-edit-month-field,
.socialItems-formBoxKustom input[type="date"]:valid::-webkit-datetime-edit-day-field,
.socialItems-formBoxKustom input[type="date"]:valid::-webkit-datetime-edit-year-field {
    color: #000;
}

.socialItems-formBoxKustom input[type="date"]::before {
    content: attr(placeholder);
    position: absolute;
    left: 0;
    top: 4px;
    width: calc(100% - 30px);
    height: 100%;
    padding-left: 8px;
    line-height: 35px;
    color: #757575;
    background: white;
    pointer-events: none;
}

.socialItems-formBoxKustom input[type="date"]:focus::before,
.socialItems-formBoxKustom input[type="date"]:valid::before {
    display: none;
}


/* Form layout moved out of the Divi child stylesheet. */
/*genes custom form styling*/

.socialItems-stage {

}

.socialItems-stage form {
	width: 90%;
	margin: 0 auto;
	background-color: white;
	padding: 40px 20px;
}

.socialItems-stage input {
	height: 40px;
	width: 100%;
	margin-bottom: 15px;
	text-indent: 5px;
}


@media only screen and (min-width: 992px) {

	.socialItems-stage input {
		margin-bottom: 20px;
	}
}

.socialItems-stage textarea {
	height: 40px;
	width: 100%;
	min-height: 75px;
	width: 100%;
	text-indent: 5px;
}

.socialItems-stage textarea::placeholder  {
	color: #cccccc;
	font-style: italic;
}

/*form styles for schedule tour and application*/

.formDisclaimer {
	padding-top: 7px;
  font-size: 10px;
  font-style: italic;
  line-height: 14px;
  color: #B1B5BD;
  display: block;
  margin: -9px 0 25px;
}

/*styles for yardi schedule a tour form*/

#yardi-time-section {
    margin-bottom: 15px;
}

#yardi-time-section > label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

#yardi-time-bubbles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.yardi-time-bubble {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    user-select: none;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4e4e4e;
}

.yardi-time-bubble:hover {
    border-color: var(--secondary-color-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.2);
}

.yardi-time-bubble.selected {
    background: var(--secondary-color-bg);
    color: white;
    border-color: #1976D2;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    transform: translateY(-2px);
}

.yardi-time-bubble.selected:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

#yardi-selected-appointment {
    background: #e8f5e8;
    padding: 18px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #4CAF50;
    font-size: 15px;
    display: none;
}

#yardi-selected-appointment strong { color: #2e7d32; }

#yardi-selected-appointment em {
    font-style: italic;
    color: #4a4a4a;
    font-size: 16px;
    font-weight: 500;
}

#yardi-no-slots-message {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #f44336;
    font-size: 15px;
    text-align: center;
}

.no-times-message {
    color: #757575;
    font-style: italic;
    text-align: center;
    padding: 30px 20px;
    font-size: 15px;
    grid-column: 1 / -1;
}

.additional-field-container {
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

@media (max-width: 768px) {
    #yardi-time-bubbles {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
    }
    .yardi-time-bubble {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 16px;
    }
}

@media (max-width: 480px) {
    #yardi-time-bubbles { grid-template-columns: repeat(2, 1fr); }
}

/* Reuse the existing form look inside .socialItems-stage */
.socialItems-stage select,
.socialItems-stage input[type="date"] {
  height: 40px;
  width: 100%;
  margin-bottom: 15px;
  text-indent: 5px;
  border: 1px solid #bbb;

}

/* Labels match other forms */
.yardi-tour-form label { color: #454B57; display:block; }

/* Two-column rows that collapse on mobile */
.form-row.two-col { display: grid; gap: 0; }
.form-row.two-col > label { width: 100%; }
@media (min-width: 768px) {
  .form-row.two-col { grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* Calendar & time chips */
#yardi-calendar-section { padding: 10px 0; }
.time-bubbles { display:flex; flex-wrap:wrap; gap:10px; }

/* Small helper text */
.yardi-tour-form small { display:block; margin: -5px 0 15px; color:#8c8c8c; }

/* Selected appointment */
#yardi-selected-appointment { margin: 10px 0; color:#666; }

/* Virtual note & no-slot message */
#yardi-no-slots-message { margin:10px 0; color:#a11; font-weight:600; }

/* a11y/focus polish to match theme-y inputs */
.socialItems-stage input[type="text"],
.socialItems-stage input[type="email"],
.socialItems-stage input[type="tel"],
.socialItems-stage input[type="date"],
.socialItems-stage select,
.socialItems-stage textarea {
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.socialItems-stage input:focus,
.socialItems-stage select:focus,
.socialItems-stage textarea:focus {
  border-color: var(--secondary-color-bg) !important;            /* tweak if your brand red differs */
  box-shadow: 0 0 0 3px rgba(157,15,20,.15);
}

/* submit button states */
.dynamicButtonSpecifics[disabled],
.dynamicButtonSpecifics.is-loading {
  opacity: .6;
  pointer-events: none;
}

/* error state helper if your JS flags .has-error on a label */
.yardi-tour-form label.has-error input,
.yardi-tour-form label.has-error select,
.yardi-tour-form label.has-error textarea {
  border-color: #c0392b;
}

.yardi-tour-form label .error-msg {
  display:block;
  margin-top:6px;
  font-size:.9rem;
  color:#c0392b;
}

/* Selected time chip = primary red */
.socialItems-formBoxKustom .time-bubbles .selected {
  background: var(--secondary-color-bg) !important;
  border-color: var(--secondary-color-bg) !important;
  color: #fff;
}

/* Inputs/selects focus ring -> red (in case any still glow blue) */
.socialItems-formBoxKustom .yardi-tour-form input:focus,
.socialItems-formBoxKustom .yardi-tour-form select:focus,
.socialItems-formBoxKustom .yardi-tour-form textarea:focus {
  border-color: var(--secondary-color-bg) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary-color-bg) !important;
  outline: none;
}

/* Help some native widgets pick up the brand color */
.socialItems-formBoxKustom .yardi-tour-form input[type="date"],
.socialItems-formBoxKustom .yardi-tour-form input[type="checkbox"],
.socialItems-formBoxKustom .yardi-tour-form input[type="radio"],
.socialItems-formBoxKustom .yardi-tour-form input[type="range"] {
  accent-color: var(--secondary-color-bg) !important;
}

/* Make the submit button behave like your Contact form button */
.socialItems-formBoxKustom .yardi-tour-form .et_pb_button {
  width: auto;                 /* stop the 100% stretch on desktop */
  display: inline-block;
  padding: 12px 28px;
  margin-top: 14px;            /* add breathing room above */
  margin-bottom: 4px;
}

/* Keep it full width on phones (nice for thumbs) */
@media (max-width: 767px) {
  .socialItems-formBoxKustom .yardi-tour-form .et_pb_button {
    width: 100%;
  }
}

/* keep desktop button not full-width + add breathing room */
.socialItems-formBoxKustom .yardi-tour-form .et_pb_button {
  width: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px !important;
  margin-top: 18px !important;   /* space above the button */
  padding: 0px 28px !important;
  text-align: center;
  margin: 0 auto !important;
}

/* full-width only on phones */
@media (max-width: 767px) {
  .socialItems-formBoxKustom .yardi-tour-form .et_pb_button {
    width: 100% !important;
  }
}

.yardiSATButton {
	padding: 10px 28px 40px !important;
	display: block !important;
}

#yardi_tour_date {
	border: 1px solid #bbb;
}

