
:root {
    --color-primary-dark: #004a60; /* Dark Blue */
    --color-light-bg: #e5f0f3; /* Light Blue-Green */
    --color-gray-text: #6b7280; /* Gray-600 */
    --color-black-text: #000000; /* Black */

    --color-cream: #f4efde; /* Cream */
    --color-teal: #005f6f; /* Teal */
    --color-darkteal: #004a57; /* Dark Teal */
    --color-blue: #e6eff1; /* Light blue */
    --color-pink: #f5e9f1; /* Pink */
    --color-light-gray: #eeeeee; /* Gray */
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f0f0;
    color: var(--color-primary-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

.page-container {
    max-width: 900px; 
    margin: 0rem auto;
    padding: 1rem 1rem 0.5rem 1rem;
    background-color: #f7f7f7;
}
@media (min-width: 900px) {
    .page-container {
        padding: 1rem 1rem 0.5rem 1rem;
        margin: 1rem auto;
        border: 1px #d0d0d0 solid;
    }
}

.text-teal { color: var(--color-teal); }
.text-gray { color: var(--color-gray-text); }
.text-black { color: var(--color-black-text); }
.font-semibold { font-weight: 550; }
.quest_title { margin:0rem;}
.quest_text { 
    margin:0rem; 
    padding: 0.25rem 0rem 0rem 0rem;
}

.section_grid_layout {
    margin-bottom: 1.5rem; 
    display:flex; 
    justify-content:space-between; 
    align-items:center;
    gap: 0.5rem;
}

/* ---------------------------------- */

@media (max-width: 600px) {
  header {
    flex-direction: column;         
    align-items: flex-start;        
    gap: 0.75rem;                   
  }

}

.header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Mobile Override: Stack inputs vertically */
@media (max-width: 600px) {
    .edit-grid-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Mobile Header Override: Stack logo and center buttons */
    .page-container > header {
        flex-direction: column;         
        align-items: center !important; /* Center items when stacked */
        gap: 0.75rem;                   
    }
    .page-container > header h1 {
        margin-bottom: 0; /* Remove bottom margin on logo for better centering */
    }
}

.countdown {
    color: rgb(0, 0, 0);
    font-weight: bold;
    background: yellow;
    font-size: small;
    padding: 0em 10px;
}

.errormsg {
    font-weight: bold;
    background: yellow;
    display: none;
    padding: 0em 0.5em;
    border-radius: 5px; 
}

.crashmsg {
    font-weight: bold;
    background: yellow;
    display: none;
    padding: 0em 0.5em;
    border-radius: 5px; 
}

.issuemsg {
    font-weight: bold;
    background: yellow;
    display: none;
    padding: 0em 0.5em;
    border-radius: 5px; 
}

.infomsg {
    display: none;
    background: rgb(255, 255, 135);
    padding: 0em 0.5em;
    border-radius: 5px; 
}

.successmsg {
    display: none;
    background: rgb(255, 255, 135);
    padding: 0em 0.0em;
    border-radius: 5px; 
}

.infotext {
    background: rgb(255, 255, 135);
}

.pwdmsg {
    color: red;
    font-size: small;
    display: none;
    padding: 0em 0.5em 0em 0em;
    border-radius: 5px; 
}

/* ---------------------------------- */


.main-heading {
    font-size: 1.5rem; 
    font-weight: 800; 
    margin-top: 0.5rem; 
    margin-bottom: 1rem; 
}
@media (min-width: 768px) {
    .main-heading {
        font-size: 1.875rem; 
    }
}

.subtext {
    margin: 0rem; 
    padding-bottom: 0.5rem;
}

.text-lg { 
    font-size: 1.125rem; 
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 1rem; 
}
@media (min-width: 768px) {
    .card-grid {
        /*grid-template-columns: repeat(2, 1fr); */ /* Two columns on desktop */
    }
    .hidden-desktop {
        display: none; 
    }
}

.questionnaire_card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--color-teal); 
    border-radius: 0rem; 
    background-color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    transition: box-shadow 150ms ease-in-out;
    cursor: pointer;
}
.questionnaire_card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); 
    background-color: #f9f9f9;
}

.icon-container {
    margin-right: 1rem; 
    padding: 0.5rem; 
    border-radius: 9999px;
    background-color: var(--color-primary-dark);
    flex-shrink: 0; 
}
.icon-placeholder {
    width: 1.5rem; 
    height: 1.5rem; 
}

/* -------------------------------------------- */        
.primary-button {
    background-color: var(--color-teal);
    color: white;
    font-size: initial;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* shadow-md */
    transition: background-color 150ms ease-in-out;
}
.primary-button:hover {
    background-color: #005f75; 
}

.login_button {
    background-color: var(--color-teal);
    font-size: 1.12rem;
    color: white;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* shadow-md */
    transition: background-color 150ms ease-in-out;
    margin: 0rem 0rem 0rem 10rem;
    width: auto;
}

.login_button:hover {
    background-color: #005f75; 
}        

.login_button:disabled {
    background-color: #cccccc;  
    color: #666666;             
    cursor: not-allowed;        
    opacity: 0.7;               
}

.home_button {
    background-color: var(--color-teal);
    font-size: 1.12rem;
    color: white;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* shadow-md */
    transition: background-color 150ms ease-in-out;
    margin: 0rem 0rem 0rem 0rem;
    width: auto;
    display: flex;
    align-items: center; /* Vertically center icon and text */
    gap: 0.5rem;         /* Small gap between icon and text */    
}

.home_button:hover {
    background-color: #005f75; 
}        

.home_button:disabled {
    background-color: #cccccc;  
    color: #666666;             
    cursor: not-allowed;        
    opacity: 0.7;               
}

.next_button {
    background-color: var(--color-teal);
    font-size: 1.12rem;
    color: white;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* shadow-md */
    transition: background-color 150ms ease-in-out;
    margin: 0rem 0rem 0rem 0rem;
    width: auto;
}

.next_button:hover {
    background-color: #005f75; 
} 

.icon_button {
    background-color: var(--color-teal);
    font-size: 1.12rem;
    color: white;
    font-weight: 600;
    padding: 0.4rem 0.4rem;
    border-radius: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* shadow-md */
    transition: background-color 150ms ease-in-out;
    margin: 0rem 0rem 0rem 0rem;
    width: auto;
    display: flex;
    align-items: center; /* Vertically center icon and text */
    gap: 0.5rem;         /* Small gap between icon and text */    
}

.icon_button:hover {
    background-color: #005f75; 
} 

/* -------------------------------------------- */
.section_title {
    font-size: 1.4rem; 
    font-weight: 750; 
    margin-top: 0.25rem; 
    margin-bottom: 1rem; 
}

.section_questionnaires, .section_messages, .section_login, .section_success, .section_email,
.section_history1, .section_mainemail, .section_mainphone, .section_mainaddress {
    background-color: var(--color-cream);
}
.section_contact_det, .section_whoami, .section_phone, .section_history2, 
    .section_edit_email_info, .section_edit_phone_info, .section_edit_address_info {
    background-color: var(--color-blue);
}
.section_password, .section_history, .section_info, .section_address, .section_history3,
 .section_otheremail, .section_otherphone {
    background-color: var(--color-pink);
}

.section_questionnaires, .section_messages, .section_contact_det, .section_whoami,
 .section_email, .section_phone, .section_address,
 .section_password, .section_history, .section_info, .section_login, .section_success,
 .section_history1, .section_history2, .section_history3, .section_edit_email_info,
 .section_mainemail, .section_mainphone, .section_mainaddress,
 .section_otheremail, .section_edit_phone_info, .section_otherphone, .section_edit_address_info {
    padding: 1.0rem 1.5rem 1.0rem 1.5rem; 
    border-radius: 0rem;
    margin-bottom: 0.75rem;
}

.section_help {
    padding: 1.0rem 1.5rem 1.0rem 1.5rem; 
    border-radius: 1.5rem;
    background-color: var(--color-light-gray);
    border: 1px solid #e5e7eb;
    margin-bottom: 0.75rem;
}


/* -------------------------------------------- */
.contact-item {
    display: flex;
    align-items: start;
    margin-bottom: 0.25rem;
    gap: 0.5rem;
}
.contact-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0rem; 
}

.contact-icon-container {
    margin-right: 1rem; 
    padding: 0.5rem; 
    border-radius: 9999px;
    background-color: var(--color-primary-dark);
    flex-shrink: 0; 
}                
.contact-icon-placeholder {
    width: 0.9rem;
    height: 0.9rem; 
}

.contact-link {
    text-decoration: underline;
    color: var(--color-teal);
    font-weight: 600;
}
.contact-link:hover {
    text-decoration: underline;
}

.a_link {
    text-decoration: underline;
    color: var(--color-teal);
    font-weight: 600;
    cursor:pointer;
}
.a_link:hover {
    text-decoration: underline;
}


/* -------------------------------------------- */
.form-field-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.form-label {
    width: 10rem; /* Fixed width for labels to align inputs */
    font-size: 1rem;
    flex-shrink: 0;
    font-weight: 500;
}

.form-input {
    padding: 0.5rem 0.75rem; /* small vertical padding, generous horizontal */
    border: 1px solid #777777; 
    border-radius: 9999px; /* Fully rounded pill shape */
    flex-grow: 1;
    max-width: 10rem; /* Max width to match the visual width of the inputs */
    background-color: white;
    transition: border-color 150ms ease-in-out;
}
.form-input:focus {
    outline: none;
    border-color: var(--color-teal);
}

#surname-initial {
    max-width: 5rem; 
}

.link {
    display: block;
    margin-left: 1rem; 
    font-size: 0.875rem;
    color: var(--color-teal);
    text-decoration: underline;
    font-weight: 600;
}
.link:hover {
    text-decoration: underline;
}

/* --- Mobile Overrides  --- */
@media (max-width: 600px) {
    .form-field-group {
        /* Mobile Override: Stack elements vertically */
        flex-direction: column;
        align-items: flex-start; 
    }

    .link {
        /* Mobile Override: Remove left margin for full width alignment */
        margin-left: 0; 
    }

    .login_button {
        margin: 0rem 0rem 0rem 0rem;
    }    
}


@media (max-width: 600px) {
    .form-label {
        /* Mobile Override: Full width, add space below */
        width: 100%;
        margin-bottom: 0.25rem; 
    }

    .form-input {
        /* Mobile Override: Full width for easy tapping */
        max-width: 100%; 
        width: 100%;
        margin-right: 2em;
    }
    
    #surname-initial {
        /* Mobile Override: Full width */
        max-width: 10rem; 
    }
}

/* --------------------------------------------- */
.contact-link {
    text-decoration: underline;
    color: var(--color-teal);
    font-weight: 600;
}
.contact-link:hover {
    text-decoration: underline;
}

/* --------------------------------------------- */
.env-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: white;
  border: 1px solid var(--color-teal);
  border-radius: 0;
  padding: 0.75rem 1rem;
}

.env-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
  padding: 0.25rem 0;
  font-size: 0.95rem;
}

.env-row:last-child {
  border-bottom: none;
}

.env-param {
  font-weight: 600;
  color: var(--color-primary-dark);
}

.env-value {
  color: var(--color-black-text);
  margin-left: 1rem;
  text-align: right;
  flex-shrink: 0;
  max-width: 60%;
  word-break: break-all;
}


/* --------------------------------------------- */

.history-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-section-content {
    background-color: white;
    padding: 1rem 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.25rem;
}

.history-item {
    display: flex;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e0e0e0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-date {
    /* Desktop Default: Fixed width to keep names aligned */
    width: 150px; 
    font-weight: 500;
    color: var(--color-primary-dark);
    flex-shrink: 0;
    margin-right: 1.5rem;
}

.history-name a {
    color: var(--color-teal);
    text-decoration: none; 
    font-weight: 600; 
}
.history-name a:hover {
    color: var(--color-darkteal);
    text-decoration: none; 
}

/* Mobile Override */
@media (max-width: 600px) {
    .history-item {
        /* Stack date and name vertically on small screens */
        flex-direction: column;
        align-items: flex-start;
    }

    .history-date {
        /* Full width, less margin on mobile */
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.25rem;
        color: var(--color-black-text);
        font-weight: 700;
    }
}


/* --------------------------------------------- */
/* --- Contact Details Layout (User Request) --- */

/* Header Row: Title on left, Button on right */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem; /* Space between header and data rows */
}

/* Make the title take up less space */
.section-header-row .section_title {
    margin: 0; /* Remove default margin for alignment */
}

/* Smaller button style for the header row */
.primary-button-small {
    background-color: var(--color-teal);
    color: white;
    font-size: 0.875rem; /* Smaller font */
    font-weight: 600;
    padding: 0.5rem 1rem; /* Smaller padding */
    border-radius: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    transition: background-color 150ms ease-in-out;
    flex-shrink: 0; /* Prevents button from shrinking */
}
.primary-button-small:hover {
    background-color: #005f75; 
}


/* Data Grid: Current (Left) | Draft (Middle) */
.data-grid-row {
    display: grid;
    /* Two columns: 50% for current, 50% for pending, side-by-side */
    grid-template-columns: repeat(2, 1fr); 
    gap: 1rem; /* Gap between the two columns */
    padding: 0.5rem 0;
    border-top: 1px solid #ddd;
}
.data-grid-row:first-of-type {
    border-top: none; /* Remove top border for the first row in the section */
}
.data-grid-row-tight {
    padding: 0.25rem 0;
    border-top: none;
    grid-template-columns: 1fr 2fr;
}

.data-cell {
    /* Styles for the individual current or pending column */
    padding: 0 0.5rem;
    word-wrap: break-word; /* Ensure long emails wrap */
}
.data-cell:first-child {
    padding-left: 0; /* Remove left padding for the first cell */
}
.data-cell-pending {

}
.data-cell-pending p {
}

.data-label-block {
    display: block;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    /*text-transform: uppercase;*/
}

.data-pending-label {
    color: rgb(92, 92, 92); 
    font-style: italic;
}

.data-value-current {
    font-weight: 500;
    color: var(--color-black-text);
    margin: 0;
}
.data-value-pending {
    font-weight: 500;
    color: var(--color-black-text);
    margin: 0;
    font-style: italic;
}
.address-line {
    /* For multi-line address, ensure minimal margin between lines */
    margin-bottom: 0.25rem !important;
}

.craftyclick_lookup {
    width: 100%;
    border-radius: 5px;
    font-size: smaller;
}

.hidden-pending {
    /* Class applied by JS to hide the entire row if no pending exists */
    display: none !important;
}

/* Mobile Override: Stack Current and Draft Vertically */
@media (max-width: 600px) {
    .data-grid-row {
        /* Switch to single column layout on small screens */
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .data-cell {
        padding: 0; /* Reset padding for stacked view */
    }
    .data-cell-pending {
    }
}

.data-cell-pending-flex {
    display: flex;
    justify-content: space-between;  /* push button to the right */
    align-items: center;             /* vertically align text and button */
    gap: 0.5rem;                     /* optional spacing */
}

.data-value-pending {
    margin: 0;                       /* remove default p tag margins */
    flex: 1;                         /* take remaining space */
}

/* --------------------------------------------- */
.section_edit_email, .section_edit_phone, .section_edit_address {
    background-color: var(--color-pink); /* Use a distinct color for the edit view */
    padding: 1.0rem 1.5rem; 
    border-radius: 0rem;
    margin-bottom: 0.75rem;
}

/* Input specific styles (inheriting from form-input, but adjusted for email width) */
.email-input, .phone-input, .address-input  {
    padding: 0.5rem 0.75rem; 
    border: 1px solid #777777; 
    border-radius: 0.5rem; /* Slightly less rounded than pill for better email appearance */
    flex-grow: 1;
    width: 100%; /* Take full width of its cell */
    max-width: 100%;
    background-color: white;
}
.address-input-tight {
    padding: 0.5rem 0.75rem; 
}
.email-input:focus, .phone-input:focus, .address-input:focus {
    outline: none;
    border-color: var(--color-teal);
}

/* Adjust the grid for the two input cells */
.edit-grid-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 2rem; /* Larger gap for the editable fields */
    padding: 1rem 0 1.5rem 0;
    border-top: 1px dashed var(--color-primary-dark);
    align-items: end;
}
.edit-grid-row:first-of-type {
    border-top: none; 
}

/* Mobile Override: Stack inputs vertically */
@media (max-width: 600px) {
    .edit-grid-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}


/* --------------------------------------------- */

.icon-button {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px; 
    margin-right: 2px;
    margin-bottom: 2px;
    border-radius: 9999px; 
    background: transparent; 
    border: 1px solid var(--color-teal);
    cursor: pointer; 
    height: 2em;
    text-decoration: none;
    vertical-align: middle;
    margin-left: 5px;
    }

.icon {
    /* Add dimensions to span */
    display: inline-block;
    width: 1.5em;
    height: 1.2em;
    /*padding-right: 2em;    */
    padding: 0em;
    padding-right: 1.7em;
    /* Add background color */
    background-color: var(--color-teal);
    /* Add mask image, use variable to reduce duplication */
    --svg: url('');
    -webkit-mask-image: var(--svg);
    mask-image: var(--svg);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}
.icon_white {
    background-color: #ffffff;
}
.icon_small {
    width: 1em;
}

.icon-eye {--svg: url('eye.svg');}
.icon-eye-off {--svg: url('eye-off.svg');}
.icon-leave {--svg: url('sign-out.svg');}
.icon-email {--svg: url('email.svg');}
.icon-phone {--svg: url('phone.svg');}
.icon-home {--svg: url('home.svg');}
.icon-quiz {--svg: url('quiz.svg');}

