/* Basic styles for the project */
body {
    font-family: Arial, Helvetica, sans-serif; /* Updated to match the referenced page */
    color: #333; /* Updated text color */
    background-color: #eff8ff; /* Reverted background color */
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 33.33%;
    min-width: 300px;
    max-width: 600px;
    min-height: 333px;
    text-align: left; /* Ensure all content inside is left-aligned */
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.logo-image {
    display: block;
    margin: 0 0 10px 0;
    max-width: 150px;
}

.title {
    font-size: 19px; /* Updated font size */
    font-weight: 600; /* Updated font weight */
    color: #000;
    margin-top: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.form-group {
    margin-bottom: 15px;
    text-align: left; /* Ensures content inside is left-aligned */
    max-width: fit-content; /* Set max-width to match the button's content width */
    margin: 0 auto; /* Center the form-group if needed */
    padding: 0; /* Removed padding */
}

/* OTP form specific adjustments: ensure group and its items are left-aligned */
.otp-group {
    text-align: left;
    margin: 0; /* ensure the group itself is left-aligned, not centered */
    width: 255px; /* match phone input width for consistency */
}
.otp-group label {
    display: block;
    font-size: 13px;
    color: #111111;
    margin-bottom: 5px;
    font-weight: normal;
    letter-spacing: 0.5px;
}

.otp-group .form-control,
.otp-group input {
    width: 100%;
    box-sizing: border-box;
}

/* Ensure the combined selector also enforces exact width when used with .form-group */
.form-group.otp-group {
    width: 255px;
}

/* Stronger enforcement for OTP group and inner items */
.form-group.otp-group {
    display: block !important;
    width: 255px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}
.form-group.otp-group label,
.form-group.otp-group input {
    width: 100% !important;
    box-sizing: border-box !important;
}
.form-group.otp-group input {
    padding: 8px 10px !important;
    height: auto !important;
}

/* Force OTP input to exact width to match wrapper */
.form-group.otp-group input {
    width: 255px !important;
    box-sizing: border-box !important;
}

#phone-form .form-group {
    max-height: 50px; /* Set maximum height to 50px */
    max-width: 255px; /* Set maximum width to 255px */
    margin-left: 0; /* Aligns the form-group to the left */
    margin-right: 0; /* Removes any centering */
    padding: 0; /* Removed padding */
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Ensure OTP label inside combined form-group keeps normal weight (overrides .form-group label) */
.form-group.otp-group label {
    font-weight: 400;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.checkbox-group {
    text-align: left;
    margin-bottom: 15px;
}

.checkbox-group input {
    margin-right: 5px;
}

.checkbox-group a {
    color: #007bff;
    text-decoration: none;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

.checkbox-group label {
    font-size: 12px; /* Updated font size for privacy agreement text */
}

.submit-button {
    background-color: #008cff; /* Updated background color */
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.submit-button:hover {
    background-color: #0056b3;
}

.instructions {
    text-align: left;
    margin-bottom: 20px;
}

.instructions p {
    font-family: Arial, Helvetica, sans-serif; /* Updated font family */
    color: #555; /* Updated text color */
    font-size: 14px; /* Adjusted font size */
    line-height: 1.6; /* Adjusted line height */
    margin: 0 0 10px 0;
}

/* Pre-call / start screen styles */
.video-start-card {
    background: #ffffff;
    border-radius: 6px;
    
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    text-align: left;
}
.call-content {
    margin-top: 6px;
    padding: 0; /* removed unwanted padding per request */
}
.call-success-title {
    font-size: 19px;
    color: #111;
    margin: 6px 0 12px 0;
    font-weight: 700; /* force bold weight for consistent rendering */
    line-height: 1.2;
    padding-left: 0px;
}
.call-subtext {
    font-size: 14px;
    color: #333;
    margin: 0 0 8px 0;
    font-weight: 700; /* make bold in all browsers */
    /* Synthesize bold if the font lacks a heavier weight and improve smoothing */
    font-synthesis: weight;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.call-instruction {
    font-size: 13px;
    color: #555;
    margin: 0 0 18px 0;
}
.call-action {
    margin-top: 6px;
}

/* Ensure the start button matches the visual weight in the mock */
.submit-button {
    background-color: #008cff;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    width: auto; /* allow sizing by max-width below */
    display: inline-block;
    min-width: 200px;
    max-width: 260px;
}
.submit-button:disabled {
    opacity: 0.7;
    cursor: default;
}

/* Local preview video (small, rounded) */
.local-preview {
    width: 220px;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e6f2ff;
    display: block;
    margin-bottom: 12px;
}

/* In-call layout: remote large video and local mini overlay */
.call-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.call-videos {
    position: relative;
    flex: 1 1 auto;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}
.remote-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.local-mini {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 180px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.call-controls {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* DTMF keypad styling */
.dtmf-keypad {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    align-items: center;
}
.dtmf-row {
    display: flex;
    gap: 6px;
}
.dtmf-key {
    width: 48px;
    height: 42px;
    border-radius: 6px;
    border: none;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}
.dtmf-key:active { transform: scale(0.98); }

/* Full in-call screen: use full browser viewport with 5px padding */
.in-call-full {
    position: fixed;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: #000;
    z-index: 9999;
    overflow: hidden;
    border-radius: 4px;
}
.in-call-remote {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}
.in-call-local {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 220px;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 1001;
}
.in-call-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.8);
    z-index: 1002;
}
.in-call-dtmf {
    position: absolute;
    right: 8px;
    top: 240px;
    z-index: 1003;
    background: rgba(0,0,0,0.9);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
/* Reduce button widths inside in-call controls to about half the desktop width */
.in-call-controls .submit-button {
    width: auto !important;
    min-width: 120px !important;
    max-width: 140px !important;
    padding: 10px 14px !important;
    font-size: 15px !important;
}

/* Icon button styles for in-call controls */
.icon-btn {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    height: 50px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.icon-btn:hover {
    transform: scale(1.08);
}
.icon-btn:active {
    transform: scale(0.95);
}

/* Hangup button - red */
.btn-hangup {
    background: #e74c3c;
    color: #fff;
}
.btn-hangup:hover {
    background: #c0392b;
}

/* Audio button - green when active (unmuted), red when muted */
.btn-audio.active {
    background: #27ae60;
    color: #fff;
}
.btn-audio.muted {
    background: #e74c3c;
    color: #fff;
}
.btn-audio.muted i::before {
    content: "\f131"; /* fa-microphone-slash */
}

/* Video button - green when active (unmuted), red when muted */
.btn-video.active {
    background: #27ae60;
    color: #fff;
}
.btn-video.muted {
    background: #e74c3c;
    color: #fff;
}
.btn-video.muted i::before {
    content: "\f4e2"; /* fa-video-slash */
}

/* Keypad button - neutral blue */
.btn-keypad {
    background: #3498db;
    color: #fff;
}
.btn-keypad:hover {
    background: #2980b9;
}

#video-container {
    text-align: left;
}

button, .submit-button {
    width: 100%; /* Make all buttons take full available width */
    max-width: 255px; /* Set max-width to 255px as requested */
    min-width: 255px; /* Ensure minimum width for consistency */
    box-sizing: border-box;
}

/* Phone Input Styling */
.phone-input-wrapper {
    width: 255px;
    margin-bottom: 15px;
    height: 40px; /* Reduced height by ~20% from 50px */
}

.phone-label {
    display: block;
    font-size: 13px;
    color: #111111;
    margin-bottom: 5px;
    font-weight: normal;
    letter-spacing: 0.5px;
}

.phone-input-container {
    display: flex;
    align-items: center;
    border: 1px solid #cecece;
    border-radius: 4px; /* Updated radius */
    height: 40px; /* Updated height */
    background-color: #fff;
    overflow: hidden;
}

.country-code {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 5px 5px;
    font-size: 13px;
    color: #111111;
    border-right: 1px solid #bbbbbb;
    height: 100%;
    justify-content: center;
}

.phone-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 10px;
    font-size: 14px;
    color: #111111;
    background: transparent;
    height: 100%;
}

.phone-input::placeholder {
    color: #999;
}

@media (max-width: 768px) {
    .container {
        width: 90%;
        min-width: unset;
        max-width: unset;
        padding: 15px;
    }

    .logo-image {
        max-width: 120px;
    }
}

/* OTP timer styles moved from inline to stylesheet */
.otp-timer {
    width: 255px;
    margin-bottom: 12px;
}
.otp-progress {
    background: #e6f2ff;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}
.otp-progress-bar {
    background: #008cff;
    height: 100%;
    width: 100%;
    transition: width 1s linear;
}
.otp-time {
    font-size: 14px;
    color: #3a74eb;
    margin-top: 6px;
}

/* Persistent inline error (matches SMS/OTP warning color and spacing) */
.persistent-error {
    /* Match the inline style used for #phone-error-container */
    color: #3a74eb;
    margin-top: 5px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    min-height: 22px;
}

/* Responsive adjustments for OTP timer */
@media (max-width: 768px) {
    .otp-timer {
        width: 255px;
        margin-bottom: 10px;
    }
    .otp-progress {
        height: 10px;
        border-radius: 5px;
    }
    .otp-time {
        font-size: 13px;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .otp-timer {
        width: 255px;
        margin-bottom: 8px;
    }
    .otp-progress {
        height: 8px;
        border-radius: 4px;
    }
    .otp-time {
        font-size: 12px;
        margin-top: 4px;
    }
}
